package edu.unf.cen6940.web;

import org.junit.Test;

import org.junit.runner.RunWith;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;

import org.springframework.context.ApplicationContext;

import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;

import org.springframework.test.context.ContextConfiguration;

import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.RequestScope;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.context.request.SessionScope;

/**
 * Unit test for the <code>GeneratedproductController</code> controller.
 *
 * @see edu.unf.cen6940.web.GeneratedproductController
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
		"file:./resources/rms_test-security-context.xml",
		"file:./resources/rms_test-service-context.xml",
		"file:./resources/rms_test-dao-context.xml",
		"file:./resources/rms_test-web-context.xml" })
public class GeneratedproductControllerTest {
	/**
	 * The Spring application context.
	 *
	 */
	private ApplicationContext context;

	/**
	 * Test <code>editGeneratedproductThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GeteditGeneratedproductThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/editGeneratedproductThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		GeneratedproductController controller = (GeneratedproductController) context.getBean("GeneratedproductController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>newGeneratedproductThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetnewGeneratedproductThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/newGeneratedproductThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		GeneratedproductController controller = (GeneratedproductController) context.getBean("GeneratedproductController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>saveGeneratedproductThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetsaveGeneratedproductThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/saveGeneratedproductThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		GeneratedproductController controller = (GeneratedproductController) context.getBean("GeneratedproductController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>confirmDeleteGeneratedproductThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetconfirmDeleteGeneratedproductThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/confirmDeleteGeneratedproductThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		GeneratedproductController controller = (GeneratedproductController) context.getBean("GeneratedproductController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>deleteGeneratedproductThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetdeleteGeneratedproductThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/deleteGeneratedproductThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		GeneratedproductController controller = (GeneratedproductController) context.getBean("GeneratedproductController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>selectGeneratedproductThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetselectGeneratedproductThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/selectGeneratedproductThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		GeneratedproductController controller = (GeneratedproductController) context.getBean("GeneratedproductController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>listGeneratedproductThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetlistGeneratedproductThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/listGeneratedproductThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		GeneratedproductController controller = (GeneratedproductController) context.getBean("GeneratedproductController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>indexGeneratedproduct()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetindexGeneratedproduct() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/indexGeneratedproduct");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		GeneratedproductController controller = (GeneratedproductController) context.getBean("GeneratedproductController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>selectGeneratedproduct()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetselectGeneratedproduct() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/selectGeneratedproduct");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		GeneratedproductController controller = (GeneratedproductController) context.getBean("GeneratedproductController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>editGeneratedproduct()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GeteditGeneratedproduct() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/editGeneratedproduct");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		GeneratedproductController controller = (GeneratedproductController) context.getBean("GeneratedproductController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>saveGeneratedproduct()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetsaveGeneratedproduct() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/saveGeneratedproduct");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		GeneratedproductController controller = (GeneratedproductController) context.getBean("GeneratedproductController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>newGeneratedproduct()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetnewGeneratedproduct() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/newGeneratedproduct");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		GeneratedproductController controller = (GeneratedproductController) context.getBean("GeneratedproductController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>confirmDeleteGeneratedproduct()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetconfirmDeleteGeneratedproduct() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/confirmDeleteGeneratedproduct");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		GeneratedproductController controller = (GeneratedproductController) context.getBean("GeneratedproductController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>deleteGeneratedproduct()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetdeleteGeneratedproduct() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/deleteGeneratedproduct");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		GeneratedproductController controller = (GeneratedproductController) context.getBean("GeneratedproductController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>generatedproductControllerbinaryaction()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetgeneratedproductControllerbinaryaction() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/generatedproductController/binary.action");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		GeneratedproductController controller = (GeneratedproductController) context.getBean("GeneratedproductController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Autowired to set the Spring application context.
	 *
	 */
	@Autowired
	public void setContext(ApplicationContext context) {
		this.context = context;
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("session", new SessionScope());
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("request", new RequestScope());
	}

	/**
	 * Returns a mock HttpServletRequest object.
	 *
	 */
	private MockHttpServletRequest getMockHttpServletRequest() {
		MockHttpServletRequest request = new MockHttpServletRequest();
		ServletRequestAttributes attributes = new ServletRequestAttributes(request);
		RequestContextHolder.setRequestAttributes(attributes);
		return request;
	}

	/**
	 * Returns a mock HttpServletResponse object.
	 *
	 */
	private MockHttpServletResponse getMockHttpServletResponse() {
		return new MockHttpServletResponse();
	}
}